<template>
  <div>
    <div v-text="message"></div>
    <div>
      测试TickNext:<input type="text" v-model:value="test" ref="inputTest">
      <button ref="btn" @click="btn1">test</button>
    </div>
  </div>
</template>

<script>
import pubsub from 'pubsub-js'

export default {
  name: "MyComponent"
  ,data(){
    return{
      message:'aa',
      test:''
    }
  }
  ,methods:{
    btn1(){
      this.$nextTick(function (){
        this.test = ''
      })
    }
  }
  ,mounted() {
    this.$bus.$emit('mc',"myComponent提供数据")
    this.pid = pubsub.subscribe('hl',(msgName,data)=>{
      this.message = data
    })
  }
  ,beforeDestroy() {
    pubsub.unsubscribe(this.pid)
  }
}
</script>

<style scoped>

</style>